#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct stu
{
    int id;
    char name[20];
    char sex;
    double x,y,z,sum,avg;
}s;
int main()
{
    int n;
    FILE* pf;
    pf=fopen("student.txt","w+");
    if(pf==NULL)
    {
        perror("fopen");
        return 1;
    }
    while(scanf("%d",&n)!=EOF)
    {
        while(n--)
        {
            scanf("%d\n",&s.id);
            gets(s.name);
            scanf("%c",&s.sex);
            scanf("%lf %lf %lf",&s.x,&s.y,&s.z);
            s.sum=s.x+s.y+s.z;
            s.avg=s.sum/3;
            fprintf(pf,"%d %d %s %c %.2lf %.2lf %.2lf %.2lf %.2lf",s.id,strlen(s.name),s.name,s.sex,s.x,s.y,s.z,s.avg,s.sum);
        }
        fclose(pf);
        pf==NULL;
    }
    return 0;
}
